<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags" %>
<!DOCTYPE HTML>
<html>
<head>
    <c:set var="contextPath" value="${pageContext.request.contextPath}"/>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我的案件</title>
    <link rel="stylesheet" type="text/css" href="${contextPath}/resources/city/css/public-style.css"/>
    <link rel="stylesheet" type="text/css" href="${contextPath}/resources/city/css/myCase.css"/>
    <link rel="stylesheet" type="text/css" href="${contextPath}/resources/city/css/public-common.css"/>
</head>
<body>
<!-- 内容 -->
<div id="main">
    <!-- 头部 -->
    <header>
        <img src="${contextPath}/resources/city/image/return.png" id="fanHui"/>
        <span id="tilte">我的案件</span>
    </header>
    <div class="nav bg">
        <div class="${listDto.listStatus.unComplete?"act":""}" url="list.htm">未处理案件</div>
        <div class="${listDto.listStatus.complete?"act":""}" url="list.htm?listStatus=COMPLETE">已处理案件</div>
    </div>
    <!-- 内容 -->
    <div class="content">
        <c:if test="${not empty listDto.list}">
            <c:forEach items="${listDto.list}" var="item" varStatus="status">
                <div class="info ${status.index%2 eq 0 ? "bg":""}">
                    <custom:front_my_case_item item="${item}"/>
                </div>
            </c:forEach>
            <a class="load_more" href="javascript:void(0);">
                <img class="loadImg" style="display: none" src="${contextPath}/resources/css/weui/load.gif">
                加载更多案件
            </a>
        </c:if>
        <c:if test="${empty listDto.list}">
            <div class="unCase">无案件</div>
        </c:if>
    </div>

</div>

<script src="${contextPath}/resources/city/js/remJs.js"></script>
<script src="${contextPath}/resources/city/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript">
    var pageNum = 2;
    $(".load_more").click(function () {
        $.ajax({
                    url: 'load_more.htm',
                    data: {currentPage: pageNum, rowSize: '${listDto.rowSize}', listStatus: '${listDto.listStatus}'},
                    beforeSend: function () {
                        $(".loadImg").css("display", "inline-block");
                    },
                    success: function (result) {
                        $(".load_more").before(result);
                        $(".loadImg").css("display", "none");
                        pageNum++;
                    }
                }
        );
    });
    $('#fanHui').click(function () {
        self.location.href = "javascript:window.history.go(-1);";
    });
    $(".nav div").click(function () {
        window.location.href = $(this).attr("url");
    });

    $(".content").on("click", ".info_right", function () {
        var attr = $(this).attr("url");
        window.location.href = attr;
    })
</script>
</body>
</html>